package com.lizonghui.progressbutton;

import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ProgressButton progressButton = (ProgressButton) findViewById(R.id.progress_botton);
        progressButton.setMax(200);
        progressButton.setProgress(50);
        float pecent = (float) (50*1.00 /200  *100);
        progressButton.setText(pecent + "%");


        ProgressView progressView = (ProgressView) findViewById(R.id.progressview);
        progressView.setIv_icon(R.drawable.ic_pause);
        progressView.setTv_note("哈哈");
        //想要进入ViewGroup子类里面的onDraw方法，必须要定义一个背景
        progressView.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));

        progressView.setMax(1000);
        progressView.setProgress(500);
        float pecent2 = 500*1.0f / 1000 *100;
        progressView.setTv_note(pecent2+"%");


    }
}
